﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace GameVLTK
{
    public class MiniMap : VisibleGameEntity
    {
        //Mini Map có kích thước tỉ lệ so với World Map
        private float _Scale;

        public float Scale
        {
            get { return _Scale; }
            set { _Scale = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        public MiniMap(ContentManager content, string path)
        {
            Texture2D[] textures;
            textures = new Texture2D[1];
            int[] framSeq = new int[1];
            textures[0] = content.Load<Texture2D>(Global.PATH_IMAGES + path);
               
            //Mỗi obj sẽ có một sprite gồm dãy các hình
            this.Sprites = new List<MySprite>();
            this.nSprites = 1;
            this.Size = new Vector2(textures[0].Width, textures[0].Height);
            this.TopLeft = new Vector2(Global.SCREEN_WIDTH- this.Size.X, 0);

            this.Scale = Global.MAP_WIDTH / (this.Size.X* 1.0f);

            //Khởi tạo sprite cho obj
            MySprite mySprite = new MySprite(textures, this.TopLeft);
            mySprite.FrameSequence = framSeq;

            this.Sprites.Add(mySprite);

        }
    }
}
